<?php
	set_time_limit(0); 
	
	$con=mysqli_connect("localhost","root","--327yqz","worktive");
	if (mysqli_connect_errno()){
		echo "Failed to connect to MySQL: " . mysqli_connect_error();
		exit;
	}
	$header = NULL;
    $datas = array();
    if (($handle = fopen("jobcategory.csv", 'r')) !== FALSE)
    {
        while (($row = fgetcsv($handle, 1000, ',')) !== FALSE)
        {
            if(!$header){
                $header = $row;
            }else{
				
				$jobCate=$row[0];
				
				$insert="INSERT INTO job_categories (job_categories_name) "; 
				$insert.="VALUES('".$jobCate."')";
				if(!mysqli_query($con,$insert)){
				  die('Error: ' . mysqli_error($con));
				}
				echo "job Category: ".$jobCate."<br/>";
			}
		}
        fclose($handle);
    }
	
	
	

?>